package com.itheima.tlais_web_management.controller;

import com.itheima.tlais_web_management.pojo.User;
import com.itheima.tlais_web_management.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/updateById")
    public boolean updateById(@RequestBody User user) {
        int result = userService.updateById(user);
        return result > 0;
    }
}